package com.yhc.entity.mapper;

import com.yhc.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

//注解方式实现数据的持久化,接口编程
@Mapper
public interface UserMapper {
    //    注解方式实现插入
    @Insert("insert into user(lname,nickname,lpassword,ppassword,state,last_update) values(" +
            "#{lname},#{nickname},#{lpassword},#{ppassword},#{state},#{lastUpdate});")
    public void insert(User user);

    //注解方式实现查询
    @Select("select uid from user where lname=#{lname} and lpassword=#{lpassword};")
    public User selectUserBylnameAndlpassword(String lname, String lpassword);
}
